import os
import cgi
import hashlib
import binascii
import random
import base64

from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.ext.webapp import template
from os import urandom



class MainPage(webapp.RequestHandler):
    
    
    def get(self):
        
        m = hashlib.md5(urandom(10).encode('hex') + 'oiesssssssssdkdljsldjslkjdslkdjskldjldjksjdlksjdsl')
#        m = hashlib.sha1
        self.response.out.write(         base64.urlsafe_b64encode(m.digest()).strip('=')      +'<br>'  )
        
        
    
class Page(db.Model):
    page_name = db.StringProperty()
    content = db.TextProperty()
    date = db.DateTimeProperty(auto_now_add=True)
    user = db.UserProperty()
    hash = db.StringProperty()
         
                    
        



application = webapp.WSGIApplication([('/.*', MainPage)], debug=True)


def main():
    run_wsgi_app(application)


if __name__ == "__main__":
    main()
